package 异常.预习作业;

import java.util.Scanner;

public class Teacher {
    private int age;//年龄
    private String name;
    private String school;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    public Teacher(int age, String name, String school) {
        this.age = age;
        this.name = name;
        this.school = school;
    }

    public void introduction () {
        System.out.println("大家好 ,我是" + name + ",学校是" + school + ",年龄是" + age);
        if (age < 22) {
            System.out.println("年龄小了");
        }
    }

    public void goClass() {
        System.out.println("开始上课");
    }
}
